﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;

namespace RN.ERP.Entity
{
    /// <summary>
    /// 管理目录 - 用户
    /// </summary>
    public class MDUser
    {
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public Int32 ID { get; set; }
        /// <summary>
        /// 用户代码
        /// </summary>
        [Key]
        public Guid UserID { get; set; }
        /// <summary>
        /// 登录名
        /// </summary>
        public String UserCode { get; set; }
        /// <summary>
        /// 显示名
        /// </summary>
        public String UserName { get; set; }
        /// <summary>
        /// 说明
        /// </summary>
        public String Description { get; set; }
        /// <summary>
        /// 部门代码
        /// </summary>
        public Int32 UnitID { get; set; }
        /// <summary>
        /// SHA-256密码
        /// </summary>
        public String Password { get; set; }
        /// <summary>
        /// 下次登录强制修改密码
        /// </summary>
        public Boolean ForcedChange { get; set; }
        /// <summary>
        /// 密码永远有效
        /// </summary>
        public Boolean ValidForever { get; set; }
        /// <summary>
        /// 有效期
        /// </summary>
        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd}")]
        public DateTime ValidDate { get; set; }
        public Boolean NeedICCard { get; set; }
        /// <summary>
        /// 是否锁定
        /// </summary>
        public Boolean IsLocked { get; set; }
        /// <summary>
        /// 已经重试密码次数
        /// </summary>
        public Byte RetryTimes { get; set; }
        /// <summary>
        /// 创建日期
        /// </summary>
        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd}")]
        public DateTime AddTime { get; set; }
        /// <summary>
        /// 是否已删除
        /// </summary>
        public Boolean IsDeleted { get; set; }
    }
}
